package Enums;

import org.ranshiyan.enumUtil.IEnum;

/**
 *
 * @author LINZHIYING823
 * @date 2019/6/24
 */
public enum SignTypeEnum implements IEnum {
    RSA("RSA", "RSA签名类型"),
    MD5("MD5", "MD5签名类型"),
    DES3("3DES", "3DES签名类型"),
    SM2("SM2","国密签名"),
    AES("AES", "AES签名类型");
    private String code;
    private String msg;

    private SignTypeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static SignTypeEnum getByCode(String code) {
        SignTypeEnum[] typeEnums = values();
        int length = typeEnums.length;

        for (int i = 0; i < length; ++i) {
            SignTypeEnum cte = typeEnums[i];
            if (cte.code.equals(code)) {
                return cte;
            }
        }

        return null;
    }

    public String getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }
}